package com.example.demo.service.impl;

import com.example.demo.dao.LevelRepository;
import com.example.demo.model.entity.LevelModel;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service
public class LevelService {

    @Resource
    LevelRepository levelRepository;

    public LevelModel save(LevelModel model) {
        return levelRepository.save(model);
    }


    public Page<LevelModel> getLevelPage(Specification specification, Pageable pageable) {
        return levelRepository.findAll(specification, pageable);
    }


    public void delete(String activityId) {
        levelRepository.delete(activityId);
    }
}
